package com.lebang.medicalInquiry.exception;



import com.lebang.medicalInquiry.exception.base.DigitalhumanBaseException;
import org.springframework.context.support.DefaultMessageSourceResolvable;
import org.springframework.validation.ObjectError;

import java.util.List;

/**
 * @version V1.0
 * @author zpc
 * @date
 */

public class ParameterException extends DigitalhumanBaseException {
    public String errorMsg;

    public ParameterException(List<ObjectError> objectErrors){
        errorMsg= objectErrors.stream().map(DefaultMessageSourceResolvable::getDefaultMessage)
                .reduce((m1,m2)->m1+":"+m2).orElse("参数缺失");
    }

}
